'''
Created on Feb 22, 2011

@author: Bogdan Mata
'''
from symbol import except_clause

# this is a comment
print("Hello", "World!")

# data types
print("Hard Times"[5])
print("giraffe"[0])

print(int("45") + int("     54"))
print(str(912) + str(219))

# Object References
x = "blue"
y = "green"
z = x

print(x, y, z)
z = y
print(x, y, z)
x = z
print(x, y, z)

route = 866
print(route, type(route))
route = "North"
print(route, type(route))

# Collection Data Types
countries = "Denmark", "Finland", "Norway", "Sweden"
print(countries)
numbers = "one",
print(numbers)

list1 = [1, 4, 9, 16, 25, 36, 49]
list2 = ['alpha', 'bravo', 'charlie', 'delta', 'echo']
list3 = ['zebra', 49, -879, 'aardvark', 200]
list4 = []

print(list1)
print(list2)
print(list3)
print(list4)

print(len(("one",)))
print(len([3, 5, 1, 2, "pause", 5]))
print(len("automatically"))

x = ["zebra", 49, -879, "aardvark", 200]
x.append("more")
print(x)
list.append(x, "extra")
print(x)
x[1] = "forty nine"
print(x)

# Logical Operations
#   The Identity Operator
a = ["Retention", 3, None]
b = ["Retention", 3, None]
print(a is b)
b = a
print(a is b)

a = "Something"
b = None
print(a is not None, b is None)

#   Comparison Operators
a = 2
b = 6
print(a == b, a <= b, a != b, a >= b, a > b)

a = "many paths"
b = "many paths"
print(a is b, a == b)

a = 9
print(0 < a < 10)

#   The Membership Operator
p = (4, "frog", 9, -33, 9, 2)
print(2 in p, "dog" not in p)

phrase = "Wild Swans by Jung Chang"
print("J" in phrase)
print("han" in phrase)

#   Logical Operators
four = 4
three = 3
two = 2
print(four or two)
print(four or three)

print(four and two)
print(four and 0)

print(not two)

#   Control Flow Statements
#        The if Statement
x = 0
if not x:
    print("x is zero")

lines = 2345    
if lines < 1000:
    print("small")
elif lines < 10000:
    print("medium")
else:
    print("large")
    
#        The while Statement
ll = ['aqaqaq', 1, 2, 3]
i = 0
while True:
    item = ll[i]
    print(item)
    i += 1
    if not i < len(ll):
        break

#       The for ... in Statement
for i in ll:
    print(i)
    
for letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
    if letter in "AEIOU":
        print(letter, "is a vowel")
    else:
        print(letter, "is a consonant")
        
#        Basic Exception Handling
'''
s = input("enter an integer: ")
try:
    i = int(s)
    print("valid integer entered:", i)
except ValueError as err:
    print(err)
'''

#    Arithmetic Operators
seeds = ["sesame", "sunflower", "pumpkin"]
seeds += ["durian"]
seeds += "durian"
print(seeds)

#    Input/Output
'''
print("Type integers, each followed by Enter; or just Enter to finish")
total = 0
count = 0
while True:
    line = input("integer: ")
    if line:
        try:
            number = int(line)
        except ValueError as err:
            print(err)
            continue
        total += number
        count += 1
    else:
        break
if count:
    print("count =", count, "total =", total, "mean =", total / count)
'''

#   Creating and Calling Functions
'''
def get_int(msg):
    while True:
        try:
            i = int(input(msg))
            return i
        except ValueError as err:
            print(err)
            
i = get_int("enter age: ")
print("Your age is: ", i)
'''

import sys

print(sys.argv)

import random
x = random.randint(1, 6)
y = random.choice(["apple", "banana", "cherry", "durian"])
print(x)
print(y)